<extend name="Public/base" />
<block name="main-content">
	<div class="page-content">
		<link rel="stylesheet" type="text/css" media="all" href="__PUBLIC__/sldate/daterangepicker-bs3.css" />
		<form name="admin_list_sea" class="form-search form-horizontal" method="post" action="{:U('news_list')}">
			<div class="row maintop">
				<div class="col-xs-12 col-sm-4">
					<select name="keytype">
						<option value="news_title" <if condition="($keytype eq 'news_title') or ($keytype eq '')">selected</if>>按标题</option>
						<option value="news_auto" <if condition="$keytype eq 'news_auto'">selected</if>>按发布人ID</option>
						<option value="news_author" <if condition="$keytype eq 'news_author'">selected</if>>按发布人名</option>
					</select>
					<select name="diyflag">
						<option value="">按属性</option>
						<foreach name="diyflag" item="v">
							<option value="{$v.diyflag_value}" <if condition="$diyflag_check eq $v['diyflag_value']">selected</if>>{$v.diyflag_name}({$v.diyflag_value})</option>
						</foreach>
					</select>
					<select name="opentype_check">
						<option value="">状态</option>
						<option value="1" <if condition="$opentype_check eq '1'">selected="selected"</if>>已审</option>
						<option value="0" <if condition="$opentype_check eq '0'">selected="selected"</if> >未审</option>
					</select>
				</div>

				<div class="col-xs-12 col-sm-3 hidden-xs btn-sespan">
					<div class="input-group">
										<span class="input-group-addon">
											<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
										</span>
						<input type="text"  name="reservation" id="reservation" class="sl-date" value="{$sldate}" placeholder="点击选择日期范围"/>
					</div>
				</div>


				<div class="col-xs-12 col-sm-3 btn-sespan">
					<div class="input-group">
									<span class="input-group-addon">
										<i class="ace-icon fa fa-check"></i>
									</span>
						<input type="text" name="key" id="key" class="form-control search-query admin_sea" value="{$keyy}" placeholder="输入需查询的关键字" />
									<span class="input-group-btn">
										<button type="submit" class="btn btn-xs btm-input btn-purple">
											<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											搜索
										</button>
									</span>
					</div>
				</div>

				<div class="input-group-btn">
					<a href="{:U('news_list')}">
						<button type="button" class="btn btn-xs all-btn btn-purple">
							<span class="ace-icon fa fa-globe icon-on-right bigger-110"></span>
							显示全部
						</button>
					</a>
				</div>


			</div>
		</form>



		<div class="row">
			<div class="col-xs-12">
				<div>
					<form id="alldel" name="alldel" method="post" action="{:U('news_alldel')}" >
						<input name="p" id="p" value="{:I('p',1)}" type="hidden" />
						<div class="table-responsive">
							<table class="table table-striped table-bordered table-hover" id="dynamic-table">
								<thead>
								<tr>
									<th class="hidden-xs center">
										<label class="pos-rel">
											<input type="checkbox" class="ace"  id='chkAll' onclick='CheckAll(this.form)' value="全选"/>
											<span class="lbl"></span>															</label>											</th>
									<th class="hidden-xs">ID</th>
									<th>文章标题</th>
									<th class="hidden-sm hidden-xs">所属栏目</th>
									<th class="hidden-sm hidden-xs">文章属性</th>
									<th class="hidden-xs">点击</th>
									<th class="hidden-xs">审核</th>
									<th class="hidden-xs">发布时间</th>
									<th style="border-right:#CCC solid 1px;">操作</th>
								</tr>
								</thead>

								<tbody>

								<foreach name="news" item="v">
									<tr>
										<td class="hidden-xs" align="center">
											<label class="pos-rel">
												<input name='n_id[]' id="navid" class="ace"  type='checkbox' value='{$v.n_id}'>
												<span class="lbl"></span>
											</label>
										</td>
										<td class="hidden-xs" align="center">{$v.n_id}</td>
										<td><a href="" target="_blank" title="{$v.news_title}">{$v.news_title|subtext=25}</a>【{$v['admin_realname']|default=$v['admin_username']}】</td>
										<td class="hidden-sm hidden-xs">{$v.menu_name}</td>
										<td class="hidden-sm hidden-xs">
											<if condition="strstr($v['news_flag'],'h') eq true"><span style="color:#03C">头</span></if>
											<if condition="strstr($v['news_flag'],'c') eq true"><span style="color:#060">荐</span></if>
											<if condition="strstr($v['news_flag'],'f') eq true"><span style="color:#09F">幻</span></if>
											<if condition="strstr($v['news_flag'],'a') eq true"><span style="color:#63C">特</span></if>
											<if condition="strstr($v['news_flag'],'s') eq true"><span style="color:#C0C">滚</span></if>
											<if condition="strstr($v['news_flag'],'p') eq true"><span style="color:#960">图</span></if>
											<if condition="strstr($v['news_flag'],'j') eq true"><span style="color:#C00">跳</span></if>
											<if condition="strstr($v['news_flag'],'d') eq true"><span style="color:#630">原</span></if>
											<if condition="strstr($v['news_flag'],'cp') eq true"><span style="color:#438eb9">产</span></if>
										</td>
										<td class="hidden-xs">{$v.news_hits}</td>
										<td class="hidden-xs">
											<if condition="$v['news_open'] eq 1">
												<a class="red state-btn" href="{:U('news_state')}" data-id="{$v.n_id}" title="已审">
													<div id="zt{$v.n_id}"><button class="btn btn-minier btn-yellow">已审</button></div>
												</a>
												<else/>
												<a class="red state-btn" href="{:U('news_state')}" data-id="{$v.n_id}" title="未审">
													<div id="zt{$v.n_id}"><button class="btn btn-minier btn-danger">未审</button></div>
												</a>
											</if>
										</td>
										<td class="hidden-xs">{$v.news_time|date='Y-m-d',###}</td>
										<td>
											<div class="hidden-sm hidden-xs action-buttons">
												<a class="green" href="{:U('news_edit',array('n_id'=>$v['n_id']))}" title="修改">
													<i class="ace-icon fa fa-pencil bigger-130"></i>
												</a>
												<a class="red confirm-rst-url-btn" data-info="你确定要删除到回收站吗？" href="{:U('news_del',array('n_id'=>$v['n_id'],'p'=>I('p',1)))}" title="回收站">
													<i class="ace-icon fa fa-trash-o bigger-130"></i>
												</a>
											</div>
											<div class="hidden-md hidden-lg">
												<div class="inline position-relative">
													<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
														<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
													</button>
													<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
														<li>
															<a href="{:U('news_edit',array('n_id'=>$v['n_id']))}" class="tooltip-success" data-rel="tooltip" title="" data-original-title="修改">
																			<span class="green">
																				<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
																			</span>
															</a>
														</li>

														<li>
															<a href="{:U('news_del',array('n_id'=>$v['n_id'],'p'=>I('p',1)))}" data-info="你确定要删除到回收站吗？" class="tooltip-error confirm-rst-url-btn" data-rel="tooltip" title="" data-original-title="回收站">
																			<span class="red">
																				<i class="ace-icon fa fa-trash-o bigger-120"></i>
																			</span>
															</a>
														</li>
													</ul>
												</div>
											</div>
										</td>
									</tr>
								</foreach>
								<tr>
									<td align="left"><button id="btnsubmit" class="btn btn-white btn-yellow btn-sm">删</button> </td>
									<td colspan="8" align="right" class="hidden-xs">{$page}</td>
									<td colspan="8" align="right" class="hidden-lg hidden-md hidden-sm">{$page_min}</td>
								</tr>
								</tbody>
							</table>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div><!-- /.page-content -->
</block>
<block name="scripts">
	<script type="text/javascript" src="__PUBLIC__/sldate/moment.js"></script>
	<script type="text/javascript" src="__PUBLIC__/sldate/daterangepicker.js"></script>
    <script type="text/javascript">
        $('#reservation').daterangepicker(null, function (start, end, label) {
            console.log(start.toISOString(), end.toISOString(), label);
        });
    </script>
</block>
